Fix deleted modifier-only primary shortcuts staying active( #498 )#503
Fix deleted modifier-only primary shortcuts staying active( #498 )#503Yaomeng1749 wants to merge 5 commits into
Conversation
|
Final verification for
|
|
Thanks for the PR. Actually, very useful PR, and thanks for finding the bug as well, but I think there is one comment that I have for you. Let me know what you think. If you think this is valid, then you can probably fix it for me and then you can merge it . "active primary press matching only uses keyCode/button. If two primary shortcuts share the same key/button with different modifiers, deleting the inactive one can clear the active held one, so release may not stop recording. Fix: store/compare the active HotkeyShortcut including modifiers." |
|
Thanks, I think this is valid. The current cleanup path identifies the active primary press by key/button only, which is fine for pairing the release event, but too broad for deciding whether a removed shortcut is the active one. With two primary shortcuts sharing the same key/button but different modifiers, removing the inactive one could clear the active press. I’ll update the active primary press state to keep the matched |
|
Implemented this in The active primary press now snapshots the matched shortcut identity, including modifiers, for removal matching. Key-up / mouse-up still only match the released key/button so releasing modifiers before the main key remains supported. I also added a regression test for the shared-key case: Local checks:
|
Summary
Fixes #498.
Clears stale Primary Dictation hotkey press state when the primary shortcut list changes. This prevents a deleted modifier-only primary shortcut from keeping a pending hold/tap path active until app restart.
Changes
updatePrimaryShortcuts(_:).Testing
Local:
GitHub Actions, same head
c2caabd26d8c2a50daa6f061e78449aa233d8d5e:Upstream Actions are awaiting maintainer approval for the public-fork workflow.